Skip to content

Fix of shrinking volumes with QCOW2 format#5225

Merged
nvazquez merged 2 commits intoapache:4.15from
slavkap:fix_shrinking_volumes
Jul 26, 2021
Merged

Fix of shrinking volumes with QCOW2 format#5225
nvazquez merged 2 commits intoapache:4.15from
slavkap:fix_shrinking_volumes

Conversation

@slavkap
Copy link
Contributor

@slavkap slavkap commented Jul 20, 2021

Description

If the volumes are in QCOW2 format, the shrinking will be handled on
the agents' side. There are cases in some storage plugins where the
volumes' format is kept in the DB in QCOW2, but the actual format is raw.
Till the current implementation, this was limiting the plugins to shrink
the volumes. Now this will be handled by the storage plugins.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

How Has This Been Tested?

manual tests with NFS/StorPool primary storages

If the volumes are with QCOW2 format the shrinking will be handled on
the agents side. There are cases in some storage plugins where the
volumes' format is kept in the DB in QCOW2 but the actual format is raw.
Till the current implementation this was limiting the plugins to shrink
the volumes. Now this will be handled by the storage plugins
@svenvogel
Copy link
Contributor

@slavkap Thanks! let me check, i come back. which version?

@svenvogel svenvogel added this to the 4.15.2.0 milestone Jul 20, 2021
@shwstppr
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian. SL-JID 627

@shwstppr
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@shwstppr a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian test result (tid-1352)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 40270 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5225-t1352-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_network.py
Intermittent failure detected: /marvin/tests/smoke/test_password_server.py
Intermittent failure detected: /marvin/tests/smoke/test_ssvm.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Smoke tests completed. 86 look OK, 1 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Failure 504.78 test_vpc_redundant.py
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers Failure 478.20 test_vpc_redundant.py
test_05_rvpc_multi_tiers Failure 485.66 test_vpc_redundant.py

Copy link
Contributor

@svenvogel svenvogel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with Managed Storage in our Test Environment. LGTM!

@svenvogel
Copy link
Contributor

@shwstppr can you check and a do a forward merge to main? we need this in main too.

Copy link
Contributor

@DennisKonrad DennisKonrad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Reverts #4679
@nvazquez @sureshanaparti okay to merge?


} catch (Exception e) {
throw new CloudRuntimeException("Exception caught during resize volume operation of volume UUID: " + volume.getUuid(), e);
throw new CloudRuntimeException(String.format("Failed to resize volume operation of volume UUID: [%s] due to - %s", volume.getUuid(), e.getMessage()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you include the exception e as the second parameter of CloudRuntimeException please?

@nvazquez
Copy link
Contributor

Looks good, I left only a comment so the exception is not swallowed when an error happens. Happy to merge forward into main as well


} catch (Exception e) {
throw new CloudRuntimeException("Exception caught during resize volume operation of volume UUID: " + volume.getUuid(), e);
throw new CloudRuntimeException(String.format("Failed to resize volume operation of volume UUID: [%s] due to - %s", volume.getUuid(), e));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slavkap I think @nvazquez meant you keep e.getMessage() there but also pass exception object as second param of the CloudRuntimeException as it has CloudRuntimeException(String message, Throwable th)

Suggested change
throw new CloudRuntimeException(String.format("Failed to resize volume operation of volume UUID: [%s] due to - %s", volume.getUuid(), e));
throw new CloudRuntimeException(String.format("Failed to resize volume operation of volume UUID: [%s] due to - %s", volume.getUuid(), e.getMessage()), e);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shwstppr, thanks! I've misunderstood the comment (sometimes I'm reading selectively... sorry about that)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry if I wasn't clear @slavkap - yes, I meant what @shwstppr explained - thanks for the fix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NP, @nvazquez, I didn't read your suggestion correctly. Thanks all for testing and code review :)

Will log the exception instead the exception message
@slavkap slavkap force-pushed the fix_shrinking_volumes branch from 295bfe0 to 7cdba5f Compare July 26, 2021 11:14
Copy link
Contributor

@nvazquez nvazquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM

@nvazquez
Copy link
Contributor

Merging based on approvals and test results

@nvazquez nvazquez merged commit 446337b into apache:4.15 Jul 26, 2021
@svenvogel
Copy link
Contributor

@nvazquez do you merge it forward? thanks for that 😄

@nvazquez
Copy link
Contributor

nvazquez commented Jul 27, 2021

@svenvogel sure, it's now included in the main branch as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants